<?php /* Smarty version 2.6.18, created on 2010-05-17 22:15:57
         compiled from categories/categories_list.html */ ?>
<script language="javascript" type="text/javascript">
	function show(div_id){
		show_div_id = "show_"+div_id;
		document.getElementById(show_div_id).style.display = '';
		hide_div_id = "hide_"+div_id;
		document.getElementById(hide_div_id).style.display = 'none';
	}
	function hide(div_id){
		show_div_id = "show_"+div_id;
		document.getElementById(show_div_id).style.display = 'none';
		hide_div_id = "hide_"+div_id;
		document.getElementById(hide_div_id).style.display = '';
	}
</script>
<table border="1">
	<th>Order</th>
	<th>Name</th>
	<th>Sub-Categories</th>
	<th>Status</th>

	<th>Action</th>
	<?php $_from = $this->_tpl_vars['categoryList']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['phantu']):
?>
		<tr> 
			<td> <?php echo $this->_tpl_vars['phantu']['cat_id']; ?>
 </td>
			<td> <?php echo $this->_tpl_vars['phantu']['cat_name']; ?>
 </td>	
			<td> 
				<?php if ($this->_tpl_vars['phantu']['cat_sub_cate']['1']): ?>
				<div id="hide_sub_cate_<?php echo $this->_tpl_vars['phantu']['cat_id']; ?>
"">
					<a href="javascript:show('sub_cate_<?php echo $this->_tpl_vars['phantu']['cat_id']; ?>
')">	
					Show!
					</a>
				</div>
				<div id="show_sub_cate_<?php echo $this->_tpl_vars['phantu']['cat_id']; ?>
" style="display:none">
				<a href="javascript:hide('sub_cate_<?php echo $this->_tpl_vars['phantu']['cat_id']; ?>
')">	
					Hide this!
				</a>
				
				<br/>
				<table border="1" cellpadding="1px" cellspacing="1px">
					<th>Name</th>
					<th>Status</th>
					<th>Action</th>
					<?php $_from = $this->_tpl_vars['phantu']['cat_sub_cate']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['phantu_con']):
?>
						<tr>
							<td> 
								<?php echo $this->_tpl_vars['phantu_con']['cat_name']; ?>
 
							</td>
							<td>
								<?php echo $this->_tpl_vars['phantu_con']['cat_status']; ?>

							</td>
						<td> 
							<a href="<?php echo @APPLICATION_URL; ?>

							categories/editForm/<?php echo $this->_tpl_vars['phantu_con']['cat_id']; ?>
">					
							edit 
							</a>
							| 
							<?php if ($this->_tpl_vars['phantu_con']['cat_status'] == 1): ?>
							<a href="<?php echo @APPLICATION_URL; ?>

											categories/inactive/<?php echo $this->_tpl_vars['phantu_con']['cat_id']; ?>
">		
								Inactive					
							</a> 
							<?php else: ?>
							<a href="<?php echo @APPLICATION_URL; ?>

								categories/active/<?php echo $this->_tpl_vars['phantu_con']['cat_id']; ?>
">					
							Active					
							</a> 
				<?php endif; ?>
						</td>			
						</tr>
					<?php endforeach; endif; unset($_from); ?>
				</table>
				</div>
				<?php else: ?>
					No sub-categories
				<?php endif; ?>
				
			</td>		
			<td> <?php echo $this->_tpl_vars['phantu']['cat_status']; ?>
 </td>		
		
			<td> 
				<a href="<?php echo @APPLICATION_URL; ?>

					categories/editForm/<?php echo $this->_tpl_vars['phantu']['cat_id']; ?>
">					
					edit 
				</a>
				| 
				<?php if ($this->_tpl_vars['phantu']['cat_status'] == 1): ?>
					<a href="<?php echo @APPLICATION_URL; ?>

											categories/inactive/<?php echo $this->_tpl_vars['phantu']['cat_id']; ?>
">					
							Inactive					
					</a> 
				<?php else: ?>
					<a href="<?php echo @APPLICATION_URL; ?>

								categories/active/<?php echo $this->_tpl_vars['phantu']['cat_id']; ?>
">					
							Active					
					</a> 
				<?php endif; ?>
			</td>			
		</tr>
	<?php endforeach; endif; unset($_from); ?>
</table>